
<include file="Common/header" />

<div class="app">

    <!-- top header -->
    <include file="Common/header_nav" />
    <!-- /top header -->

    <section class="layout">
        <!-- sidebar menu -->
        <include file="Common/left_aside" />
        <!-- /sidebar menu -->

        <!-- main content -->
        <section class="main-content">
            <header class="header navbar bg-default">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="/Home/MyQuiz/">参加测试</a>
                    </li>
                    <li class="active">
                        <a href="#">我的报告</a>
                    </li>

                </ul>
            </header>
            <!-- content wrapper -->
            <div class="content-wrap">

                <section class="panel panel-info">
                    <header class="panel-heading">我的报告</header>
                    <div class="panel-body">

                        <table id="report-result" width="100%" border="1" class="table table-bordered table-striped mg-t">

                        </table>

                    </div>
                </section>

            </div>
            <!-- /content wrapper -->

        </section>
        <!-- /main content -->

    </section>

</div>

<include file="Common/footer" />

<include file="MyQuiz/scripts" />

<!--<script src="__ROOT__/Public/asset/js/quiz/myreport.js"></script>-->

<script src="__PUBLIC__/asset/vendor/bootstrap-table/bootstrap-table.min.js"></script>
<script src="__PUBLIC__/js/tableTools.js"></script>

<script>
    $(document).ready(function() {

        $.ajax({
            type:"GET",
            url:"/Home/Index/isOrg",
            dataType:"json",
            async : false,
            success:function(data){

                if (data.code == 0){
                    $("#li-org").hide();
                }

            },error: function (jqXHR) {
                alert("获取组织者权限failed"+jqXHR.status);
            }
        });

        $(".main-navigation ul").find('li').removeClass('active');
        $(".main-navigation ul").find('li:eq(1)').addClass('active');



        function columns(){
            return [
                {
                    field: 'state',
                    checkbox: true
                },{
                    field:'quiz_id',
                    title:'问卷id'
                },{
                    field:'quiz_pagetitle',
                    title:'问卷名',
                    formatter:Formatter
                },{
                    title:'',
                    formatter:function(value, row, index){
                        console.log(row);
                        return '<a class="btn btn-sm btn-primary" href="/Home/MyQuiz/showReport/quiz_name/'+row.quiz_name+'">'+"显示报告"+'</a>';
                       // return '<a class="btn btn-sm btn-primary" href="/Home/MyQuiz/showReport?quiz_name='+row.quiz_name+'>显示报告</a>';
                    }
                }];
        }


        function Formatter(value, row, index)
        {
            return '<a href="#">'+value+'</a>';
        }




        var tabletool = new TableTools();
        tabletool.bstable("report-result","/Home/MyQuiz/getReportList", columns(),"","");





//        $("#datatable").dataTable({
//            "processing": true,
//            "serverSide": true,
//            "ajax" : "/Public/asset/data/myreport_datatable.txt",
//            "columns": [
//                {"data": "quiz_name", "bSortable": false},
//                {"data": "quiz_timestamp"},
//                {"data": "quiz_option"},
//                {"data": "quiz_who"},
//                {"data": "quiz_serieskey"}
//            ],
//            "columnDefs": [
//                {
//                    "targets": [2],
//                    "data": "quiz_option",
//                    "render": function(data, type, full) {
//                        return '<a href="/Home/MyQuiz/show_16pf" id="see-report">查看报告</a>';
//                    }
//                }
//            ]
//        });
//
//
////        $(document).on("click", "#see-report", function(){
////            $("#see-report").attr("href", "");
////            alert("管理员设置了发送邮箱，请等待通知查收自己的邮箱看报告~");
////        });

    });




</script>